<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>">
<title>投保预览</title>
<%@ include file="/WEB-INF/jsp/common/common.jsp"%>
<link rel="stylesheet" href="css/jquery.datetimepicker.css"
	type="text/css" />
<link rel="stylesheet"
	href="css/poshytip/tip-yellowsimple/tip-yellowsimple.css"
	type="text/css" />
<script type="text/javascript" src="js/jquery.datetimepicker.js"></script>
<script src="js/jquery.validate.js" type="text/javascript"></script>
<script src="js/jquery.divbox.js" type="text/javascript"></script>
<script src="js/json2.js" type="text/javascript"></script>
<script type="text/javascript" src="js/poshytip/jquery.poshytip.js"></script>
<style type="text/css">
.table_my th {
	color: #343233;
	width: 11%;
	text-align: center;
	line-height: 26px;
	border-bottom: 1px #bbcddb solid;
	font-weight: 700;
}

</style>
<script type="text/javascript">
$(function(){
	var totPremamt= '${facadeAppForm.totPremamt}';
    var premNotax= '${facadeAppForm.premNotax}';
    var premVat= '${facadeAppForm.premVat}';
    var cardTotPremamt = '${prodInfo.cardInfo.totPremamt}';
    totPremamt = fmoney(parseFloat(totPremamt));
    premNotax = fmoney(parseFloat(premNotax));
    premVat = fmoney(parseFloat(premVat));
    cardTotPremamt=fmoney(parseFloat(cardTotPremamt));
    $("#totPremamt").html(totPremamt);
    $("#premNotax").html(premNotax);
    $("#premVat").html(premVat);
    $("#cardTotPremamt").html(cardTotPremamt);
    var global_SPECIAL_INFO = '${global_SPECIAL_INFO}';
    var riskMainType='${riskMainType}';
//     //麻醉险
//     if(global_SPECIAL_INFO != '1'){
//         $('#anesthType').hide();
//     }
//     //旅意险
//     if(riskMainType != '3'){
//         $('#tripId').hide();
//     }
//     //学平险
//     if(riskMainType != '1'){
//         $("[name='learning']").hide();
//     } 
    //驾乘险
    if(riskMainType == '2'){
    	if('0'==global_SPECIAL_INFO){
       	 $("[name='drivingInfo']").hide();
       	 $("[name='drivingInfo1']").show();
       	 $("[name='seatInfo']").hide();
	        $("#common").hide();
	        $("#drivingShow").hide();
	        $(".appInsuredClass").show();
	        $("#commonInsure").show();
    	}else{
        $("[name='drivingInfo']").show();
        $("[name='drivingInfo1']").show();
        $("[name='seatInfo']").show();
        $("#common").show();
        $("#drivingShow").show();
        $(".appInsuredClass").hide();
        $("#commonInsure").hide();
    	}
    }else{
        $("[name='drivingInfo']").hide();
        $("[name='drivingInfo1']").hide();
        $("#common").hide();
    }
    //乘意险
    if(riskMainType != '7'){
    	$("[name='ticketInfo']").hide();
    }else{
        $("[name='ticketInfo']").show();
    }
    //驾意险
    if(riskMainType == '9'){
        $("#vehicleNatureId").show();
    }
//     //借意险
//     if(riskMainType != '6'){
//         $("[name='loanInfo']").hide();
//     } 
	init();
	var warnInfo = $("#warnInfo").val();
    if(warnInfo!=null&&""!=warnInfo){
    	$("#checkInfo").html(warnInfo);
    	$("#checkI1").show();
    	$("#checkI2").show();
    }
});
function init() {
	stepConObj.curStepIndex=2;//当前已完成索引位置
	if('${pricelessType}'=="1"){
	    stepConObj.stepContentFlag="2";//1非见费和2见费标识
	}else{
	    stepConObj.stepContentFlag="1";//1非见费和2见费标识
	}
    stepControl(stepConObj);
}
//function backToEdit(stagNo,cardNo){
//    $.openLoading();
//    window.location.href="<%=path%>/activatedCard/single/add?cardNo="+cardNo+"&stagNo="+encodeURIComponent(stagNo)+"&editFlag=edit";
//}
function insureSubmit(stagNo,cardNo){
    var totPremamt = $("#totPremamt").html().replace(/,/g, "");
    var cardTotPremamt=$("#cardTotPremamt").html().replace(/,/g, "");
	if(totPremamt-cardTotPremamt!=0){
        $.message("error","卡单保费和保单保费不一致，不能投保！");
    }else{
	    $.openLoading_jhk();
	    window.location.href="<%=path%>/activatedCard/single/confirmSingle?stagNo="+encodeURIComponent(stagNo)+"&cardNo="+cardNo;
    }
}
function returnBack(stagNo){
    $.openLoading_jhk();
    window.location.href="<%=path%>/activatedCard/single/add?stagNo="+encodeURIComponent(stagNo);
}
</script>
</head>
<body>
	<div class="current">
		<table class="current_table_1">
			<tbody>
				<tr class="f2">
					<td><img src="./images/current_1.jpg"></td>
					<td class="current_table_1_td"><img src="images/current_1.png">&nbsp;您现在的位置：&nbsp;
						<span style="color: #136bab;">激活卡管理 <span
							style="padding: 0 5px; font-weight: bold; line-height: 28px;">&gt;</span>激活卡激活
							<span
							style="padding: 0 5px; font-weight: bold; line-height: 28px;">&gt;</span>投保预览
					</span></td>
					<td><img src="./images/current_3.jpg"></td>
				</tr>
			</tbody>
		</table>
	</div>
	<form action="" method="post" id="mainForm">
		<div class="setp"><jsp:include page="../include/stepScroll.jsp" /></div>
		<input type="hidden" name="stagNo" id="stagNo" value="${stagNo}" /> 
		<input type="hidden" name="warnInfo" id="warnInfo" value="${warnInfo}" /> 
		<input type="hidden" name="appNo" id="appNo" value="${appNo}" /> 
		<input type="hidden" name="planNo" id="planNo" value="${planNo}" /> 
		<input type="hidden" name="planName" id="planName" value="${planName}" />
		<div>
			<table class="table_05">
				 <tr id="checkI1" style="display: none;">
                    <td colspan="4"
                        style="font-size: 12px; font-weight: bold; text-align: left; color: #3876bf; line-height: 17px; background-image: url(images/centent_1.jpg)">黑名单信息</td>
                </tr>
				<tr id="checkI2" style="display: none;">
					<td colspan="4"
		                        style="font-size: 12px; font-weight: bold; text-align: center; background:yellow;color:black; line-height: 17px;" id="checkInfo"></td>
				</tr>
				<tr>
					<td colspan="4"
						style="font-size: 12px; font-weight: bold; text-align: left; color: #3876bf; line-height: 17px; background-image: url(images/centent_1.jpg)">卡单信息</td>
				</tr>
				<tr>
					<th width="25%">卡定义名称：</th>
					<td width="28%">${prodInfo.cardInfo.name}</td>
					<th width="22%">卡号：</th>
					<td width="20%">${prodInfo.cardInfo.cardNo}</td>
				</tr>
				<tr>
					<th>保费：</th>
					<td colspan='3'><span id='cardTotPremamt'></span>元</td>
				</tr>
				<tr>
					<td colspan="4"
						style="font-size: 12px; font-weight: bold; text-align: left; color: #3876bf; line-height: 17px; background-image: url(images/centent_1.jpg)">基本信息
					</td>
				</tr>
				<tr>
					<th>投保方案：</th>
					<td>${planName}</td>
					<th>即时起保：</th>
					<td><c:if test="${facadeAppForm.realSignFlag eq 'Y'}">是</c:if>
						<c:if test="${facadeAppForm.realSignFlag eq 'N'}">否</c:if></td>
				</tr>
				<!--                 <tr style="display:none;" id="tripId"> -->
				<!--                     <th>行程/航班：</th> -->
				<!--                     <td colspan='3'> -->
				<%--                         ${facadeAppForm.trip} --%>
				<!--                     </td> -->
				<!--                 </tr> -->
				<tr>
					<th id="globalDMY">保险天数：</th>
					<td>${facadeAppForm.dayCount}</td>
					<th>起保日期：</th>
					<td>${effDate}</td>
				</tr>
				<!--                 <tr> -->
				<!--                     <th width="42%">投保份数：</th> -->
				<!--                     <td width="53%" id="unirPpFlag"> -->
				<%--                         ${facadeAppForm.unirPp} --%>
				<!--                     </td> -->
				<!--                 </tr> -->
				<tr>
					<th>终保日期：</th>
					<td>${termDate}</td>
                    <th>含税保费：</th>
                    <td><span id='totPremamt' style="color: red; font-size: 20px;"></span>元
                    </td>
				</tr>
				<tr>
                    <th>不含税保费：</th>
                    <td><span id='premNotax'></span>元</td>
                    <th>增值税额：</th>
                    <td><span id='premVat'></span>元</td>
                </tr>
				<tr style="display: none;" id="vehicleNatureId">
                    <th>车辆性质：</th>
                    <td colspan='3'>
                        <c:forEach var="n" items="${mainVehicleNatureList}">
                            <c:if test="${facadeAppFormExtend.mainVehicleNatureStr eq n.code}">${n.codeName}</c:if>
                        </c:forEach>
                    </td>
                </tr>
				<tr name="drivingInfo">
                    <th>车牌号：</th>
                   <td>
                       ${facadeAppFormExtend.plateNum}
                   </td>
                    <th>车架号：</th>
                   <td>
                       ${facadeAppFormExtend.chassisNum}
                   </td>
                </tr>
                <tr name="drivingInfo1">
                    <th name='seatInfo'>投保座位数：</th>
                   <td name='seatInfo'>
                       ${facadeAppFormExtend.seatNum}
                   </td>
                    <th>车辆性质：</th>
                   <td>
                       <c:forEach var="n" items="${mainVehicleNatureList}">
                           <c:if test="${facadeAppFormExtend.mainVehicleNatureStr eq n.code}">${n.codeName}</c:if>
                        </c:forEach>
                   </td>
                </tr>
				<tr name="ticketInfo">
					<th>车次号：</th>
					<td>${facadeAppFormExtend.trainNumber}</td>
					<th>座位号：</th>
					<td>${facadeAppFormExtend.seatNumber}</td>
				</tr>
				<tr name="ticketInfo">
					<th>发车时间：</th>
					<td>${facadeAppFormExtend.departureTime}</td>
					<th>到达时间：</th>
					<td>${facadeAppFormExtend.arrivalTime}</td>
				</tr>
				<tr name="ticketInfo">
					<th>车票号：</th>
					<td>${facadeAppFormExtend.ticketNumber}</td>
					<th>交通工具：</th>
					<td>
					    <c:forEach var="n" items="${vehicleList}">
                            <c:if test="${facadeAppFormExtend.vehicle eq n.code}">${n.codeName}</c:if>
                        </c:forEach>
                    </td>
				</tr>
				<tr name="ticketInfo">
					<th>客票号码：</th>
					<td>${facadeAppFormExtend.ticketNo}</td>
					<th>出发地点/起始站：</th>
					<td>${facadeAppFormExtend.departureStation}</td>
				</tr>
				<tr name="ticketInfo">
					<th>到达地点/到达站：</th>
					<td colspan='3'>${facadeAppFormExtend.arrivalStation}</td>
				</tr>
				<!--                <tr id = "anesthType"> -->
				<!--                    <th>麻醉类型：</th> -->
				<!--                    <td colspan='3'> -->
				<%--                        ${facadeAppFormExtend.ANESTH_TYPE_NAME} --%>
				<!--                    </td> -->
				<!--                 </tr> -->
				<!--                 <tr name = "loanInfo"> -->
				<!--                    <th>借款时间：</th> -->
				<!--                    <td> -->
				<%--                        ${facadeAppForm.stringBorrowTime} --%>
				<!--                    </td> -->
				<!--                    <th>还款时间：</th> -->
				<!--                    <td> -->
				<%--                        ${facadeAppForm.stringRepayTime} --%>
				<!--                    </td> -->
				<!--                 </tr> -->
				<!--                 <tr name = "loanInfo"> -->
				<!--                    <th>贷款银行网点名称：</th> -->
				<!--                    <td> -->
				<%--                        ${facadeAppForm.loanBankSitename} --%>
				<!--                    </td> -->
				<!--                    <th>银行联系人：</th> -->
				<!--                    <td> -->
				<%--                        ${facadeAppForm.bankLinkerName} --%>
				<!--                    </td> -->
				<!--                 </tr> -->
				<!--                 <tr name = "loanInfo"> -->
				<!--                    <th>银行联系电话：</th> -->
				<!--                    <td> -->
				<%--                        ${facadeAppForm.bankLinkerPhone} --%>
				<!--                    </td> -->
				<!--                    <th>还款方式：</th> -->
				<!-- 					<td> -->
				<%-- 					    <c:forEach var="repaidTypes" items="${repaidTypeList}"> --%>
				<%-- 						    <c:if test="${facadeAppForm.repaidType eq repaidTypes.code}">${repaidTypes.codeName}</c:if> --%>
				<%-- 						 </c:forEach> --%>
				<!-- 				    </td> -->
				<!-- 				</tr> -->
				<!--                 <tr name = "loanInfo"> -->
				<!--                    <th>保额确定方式：</th> -->
				<!--                     <td colspan='3'> -->
				<%--                        <c:forEach var="loanWays" items="${loanWayList}"> --%>
				<%--                            <c:if test="${facadeAppForm.loanWay eq loanWays.code}">${loanWays.codeName}</c:if> --%>
				<%--                        </c:forEach> --%>
				<!--                     </td> -->
				<!--                 </tr> -->
				
				<tr>
					<td colspan="4"
						style="font-size: 12px; font-weight: bold; text-align: left; color: #3876bf; line-height: 17px; background-image: url(images/centent_1.jpg)">投保人信息
					</td>
				</tr>
				<tr>
					<th>投保人姓名：</th>
					<td>${facadeAppApplicant.clientName}</td>
					<th>证件类型：</th>
					<td><c:forEach var="idTypes" items="${idTypeList}">
							<c:if
								test="${facadeAppApplicant.certificateType eq idTypes.code}">${idTypes.codeName}</c:if>
						</c:forEach></td>
				</tr>
				<tr>
					<th>证件号码：</th>
					<td>${facadeAppApplicant.certificateCode}</td>
					<th>出生日期：</th>
					<td>${facadeAppApplicant.clientBir}</td>
				</tr>
				<tr>
					<th>性别：</th>
					<td><c:if test='${facadeAppApplicant.sex eq 1}'>男</c:if> <c:if
							test='${facadeAppApplicant.sex eq 2}'>女</c:if></td>
					<th>手机号码：</th>
					<td>${facadeAppApplicant.linkmanTel}</td>
				</tr>
				<tr id="common">
					<th>电子邮箱：</th>
					<td colspan='3'>${facadeAppApplicant.email}</td>
				</tr>
				<tr id="commonInsure">
					<th>电子邮箱：</th>
					<td>${facadeAppApplicant.email}</td>
					<th>与被保人关系：</th>
					<td><c:forEach var="rela" items="${relaList}">
							<c:if test="${facadeAppApplicant.relWithInsured eq rela.code}">${rela.codeName}</c:if>
						</c:forEach></td>
				</tr>
			</table>
		</div>
	      <div id="drivingShow" style="display:none">
	       <table class="table_05 ">
	          <tr>
	              <td colspan="4"
	                  style="font-size: 12px; font-weight: bold; text-align: left; color: #3876bf; line-height: 17px; background-image: url(images/centent_1.jpg)">被保人信息
	              </td>
	          </tr>
	          <tr>
	            <td colspan='4'>发生保险责任范围内的交通事故时驾驶或乘坐本保险合同载明的车辆内的人员</td>
	          </tr>
	      </table>
	      </div>
		<div class="appInsuredClass">
			<table class="table_05 ">
				<tr>
					<td colspan="4"
						style="font-size: 12px; font-weight: bold; text-align: left; color: #3876bf; line-height: 17px; background-image: url(images/centent_1.jpg)">被投保人信息
					</td>
				</tr>
				<tr>
					<th width="25%">被保人姓名：</th>
					<td width="28%">${facadeAppInsured.clientName}</td>
					<th width="22%">证件类型：</th>
					<td width="20%"><c:forEach var="idTypes" items="${idTypeList}">
							<c:if test="${facadeAppInsured.idType eq idTypes.code}">${idTypes.codeName}</c:if>
						</c:forEach></td>
				</tr>
				<tr>
					<th>证件号码：</th>
					<td>${facadeAppInsured.idNo}</td>
					<th>出生日期：</th>
					<td>${facadeAppInsured.clientBir}</td>
				</tr>
				<tr>
					<th>性别：</th>
					<td><c:if test='${facadeAppInsured.sex eq 1}'>男</c:if> <c:if
							test='${facadeAppInsured.sex eq 2}'>女</c:if></td>
					<th>联系电话：</th>
					<td>${facadeAppInsured.clientTel}</td>
				</tr>
				<tr>
                    <th>职业类别：</th>
                    <td colspan='3'>${facadeAppInsured.workTypeName}</td>
                </tr>
				<!--                 <tr name ="learning"> -->
				<!--                     <th>学生类别：</th> -->
				<!--                     <td> -->
				<%--                         <c:forEach var="studentType" items="${studentTypeList}"> --%>
				<%--                             <c:if test="${facadeAppInsured.studentType eq studentType.code}">${studentType.codeName}</c:if> --%>
				<%--                         </c:forEach> --%>
				<!--                     </td> -->
				<!--                     <th>学校类别：</th> -->
				<!--                     <td> -->
				<%--                         <c:forEach var="schoolType" items="${schoolTypeList}"> --%>
				<%--                             <c:if test="${facadeAppInsured.schoolType eq schoolType.code}">${schoolType.codeName}</c:if> --%>
				<%--                         </c:forEach> --%>
				<!--                     </td> -->
				<!--                 </tr> -->
				<!--                 <tr name ="learning"> -->
				<!--                     <th>院校类别：</th> -->
				<!--                     <td colspan='3'> -->
				<%--                         <c:forEach var="schoolNature" items="${schoolNatureList}"> --%>
				<%--                             <c:if test="${facadeAppInsured.schoolNature eq schoolNature.code}">${schoolNature.codeName}</c:if> --%>
				<%--                         </c:forEach> --%>
				<!--                     </td> -->
				<!--                 </tr> -->
			</table>
		</div>
		<div id="bbrDiv">
			<table class="table_05">
				<tr>
					<td colspan="2"
						style="font-size: 12px; font-weight: bold; text-align: left; color: #3876bf; line-height: 17px; background-image: url(images/centent_1.jpg)">受益人信息
					</td>
				</tr>
				<tr>
					<td colspan="2">&nbsp;受益人&nbsp;&nbsp;&nbsp;&nbsp;法定<br /></td>
				</tr>
			</table>
		</div>
		<div id="bbrDiv">
			<table class="table_my table_05">
				<thead>
					<tr>
						<td colspan="3"
							style="font-size: 12px; font-weight: bold; text-align: left; color: #3876bf; line-height: 17px; background-image: url(images/centent_1.jpg)">条款责任信息
						</td>
					</tr>
					<tr>
						<th width="40%">条款名称</th>
						<th width="30%">责任名称</th>
						<th width="30%">保额</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach var="planBase" items="${planBaseLists}">
						<tr>
							<td style="width: 40%; text-align: center">${planBase.RISK_NAME}</td>
							<td style="width: 30%; text-align: center">${planBase.COV_NAME}</td>
							<td style="width: 30%; text-align: center">${planBase.COV_AMT}</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>
		<div id="bbrDiv">
			<table class="table_05">
				<tr>
					<td colspan="4"
						style="font-size: 12px; font-weight: bold; text-align: left; color: #3876bf; line-height: 17px; background-image: url(images/centent_1.jpg)">特别约定
					</td>
				</tr>
				<tr>
					<td colspan="4">${specialArran}<c:if
							test="${empty specialArran}">无</c:if></td>
				</tr>
				<tr>
					<td colspan="4"
						style="font-size: 12px; font-weight: bold; text-align: left; color: #3876bf; line-height: 17px; background-image: url(images/centent_1.jpg)">温馨提示
					</td>
				</tr>
				<tr>
					<td colspan="4">${notice}<c:if test="${empty notice}">无</c:if></td>
				</tr>
			</table>
		</div>
		<br> <br>

		<div align="center">
			<input class="input_button_2" name="" type="button"
				onclick="returnBack('${stagNo}')" value="返  回">&nbsp;&nbsp;
			<input class="input_button_2" name="" type="button"
				onclick="insureSubmit('${stagNo}','${cardInfo.cardNo}')" value="投保">
		</div>
		<br>
	</form>
</body>
</html>